package com.itheima.controller;

import com.itheima.domain.Departments;
import com.itheima.service.DepartmentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author zhengjd
 * @date 2020/3/24 19:54
 */
@Controller
@RequestMapping("/Depart")
public class DepartmentsController {

    @Autowired
    DepartmentsService departmentsService;

    @ResponseBody
    @RequestMapping("/findAll")
    public List<Departments> findAll(){
        List<Departments> departments = departmentsService.findAll();
        return departments;
    }
}
